#!/usr/bin/ksh


user=Z1000092 
build_dir=/opt/apps/build
bea_home=/opt/bea

grep $user /etc/passwd 
if [[ $? -eq 1 ]]; then
        echo "Adding $user to `hostname`"
        useradd $user   
        passwd $user
else
        echo "$user already exists on `hostname`"
fi

for dir in /opt/apps ${ANT_WL_HOME} ${ANT_BUILD_DIR} ${ANT_NM_HOME}
do
        if [[ ! -d $dir ]]; then
                mkdir $dir;
                echo "Created $dir on `hostname`"
        else
                echo "$dir exists on `hostname`"
        fi
        chown -R $user $dir     
        echo "Changed owner of $dir to $user"

        echo ""
        echo ""
done